<?php
namespace app\index\controller;

class Index
{
    public function __construct()
    {
        $this->cdn = config('cdn');
    }

    public function index()
    {
        $msg = urlencode("吃饭了吗");

        $url = "http://api.qingyunke.com/api.php?key=free&appid=0&msg=$msg";


        $json = file_get_contents($url);

        $array = json_decode($json, true);

        $content = isset($array['content']) ? $array['content'] : '暂时听不懂你说啥';

        echo $content;

    }
}
